<html>
<head>
<title>SSIM</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
<!--
Automatically generated, don't change:
$Id: ssim.htm,v 1.2 2004/08/17 20:31:19 wilbertd Exp $ 
-->
</head>
<body>
<h1>SSIM</h1>
<h2>Abstract</h2>
<b>author:</b>  Lefungus
<br><b>version:</b>  0.23
<br><b>download:</b>   <a href="http://www.avisynth.org/warpenterprises/">http://www.avisynth.org/warpenterprises/</a>
source: can be found <a href="http://perso.wanadoo.fr/reservoir/dl/SSIMSrc-0.23.rar">here</a>.<br>
<b>category:</b>  Plugins to compare video quality using specific video quality
metrics<br>
<b>requirements:</b> YV12 Colorspace
<hr>
<h2>Description</h2>
<p>This filter has been created following the ideas of
 <a href="http://www.cns.nyu.edu/~zwang/" target="_blank"><cite>Zhou Wang</cite></a>.<br>
It has been coded with the great help of Mfa, who worked on the core functions.
<p>For a given reference video and a given compressed video, it is meant to compute
a quality metric, based on perceived visual distortion. Unlike the well-known
PSNR measure, it's not purely mathematical, and should correlate much better
with human vision.<br>
Some examples can be found
 <a href="http://http://www.cns.nyu.edu/~zwang/files/research/quality_index/demo_lena.html" target="_blank"><cite>here</cite></a>.<br>
A higher MSE (and so lower PSNR) should mean that the compressed clip is a worse
image but MSE and PSNR are flawed in this respect as numerous tests have shown.
However with SSIM, according to tests carried out on the VQEG dataset, a higher
Q (SSIM value) has a much better relation to the visual quality of the
compressed clip. Despite this, bear in mind the SSIM metric still isn't perfect.
<p>This filter is designed to compute an SSIM value by two methods, the original
one, and a &quot;enhanced&quot; one that weight these results by lumimasking. On
the todo list is to include the motion weighting.
<p>This filter has five parameters:
<p><code>SSIM</code> (<var>clip1, clip2, &quot;results.csv&quot;, &quot;averageSSIM.txt&quot;,
lumimask=true</var>)<p><var>clip1</var> and <var>clip2</var> are the reference clip and the compressed clip.<br>
<var>&quot;results.csv&quot;</var> is the file where obtained SSIM values will be written (this can be
easily read in excel or notepad for those unfamiliar with the comma separated
variables format)<br>
lumimasking switch between the two methods.
<p>When the video is closed, the filter will write a file named <var> &quot;averageSSIM.txt&quot;</var>
that will contain the global SSIM value.
<p>An SSIM value is between 0 and 1, 1 meaning perfect quality.
<p>To analyse locally the results, you could use the csv files, and manipulate data
in any excel-clone. Examples:</p>
<ul>
  <li><a href="http://perso.wanadoo.fr/reservoir/dl/ssim.png" target="_blank"><cite>codec A
vs codec B</cite></a></li>
  <li><a href="http://perso.wanadoo.fr/reservoir/dl/ssimlumi.png" target="_blank"><cite>codec
A with lumi option</cite></a></li>
</ul>
<p>In the csv file, when lumimasking is activated, both SSIM values and its weigth
is written.
<p><b>Note:</b>
<p>If you use B frames under xvid, trim the first dummy frame of the xvid clip,
and the last frame of the original clip.<p><kbd>$Date: 2004/08/17 20:31:19 $</kbd>
</body>
</html>